import request from '@/utils/request'

export function getAll(params) {
	return request({
		url: '/goods',
		method: 'get',
		params
	})
}

export function get(params) {
	return request({
		url: '/good/'+ params,
		method: 'get'
	})
}

export function deleteGood(params) {
	return request({
		url: '/good/'+ params,
		method: 'put'
	})
}


export function add(data) {
	return request({
		url: '/good',
		method: 'post',
		data
	})
}

export function update(data) {
	return request({
		url: '/good',
		method: 'put',
		data
	})
}


export function upload(data) {
	return request({
		url: '/oss/upload',
		method: 'post',
		data,
		headers: {
			"Content-Type": 'multipart/form-data'
		}
	})
}
